package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.ConfirmSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.ConfirmSL;

@Component
public class ConfirmSLConverter extends AbstractConverter<ConfirmSL, ConfirmSLDTO> {

    @Override
    public ConfirmSL toModel(final ConfirmSLDTO dto) {

        final ConfirmSL model = new ConfirmSL();

        model.setWorkOrderNum(dto.getWorkOrderNum());
        model.setTaskId(dto.getTaskId());
        model.setCreateUser(dto.getCreateUser());
        model.setCreateUserName(dto.getCreateUserName());
        model.setMainId(dto.getMainId());

        return model;
    }

    @Override
    public ConfirmSLDTO toDTO(final ConfirmSL model, final boolean forListView) {

        final ConfirmSLDTO dto = new ConfirmSLDTO();

        dto.setId(model.getId());
        dto.setWorkOrderNum(model.getWorkOrderNum());
        dto.setTaskId(model.getTaskId());
        dto.setCreateUser(model.getCreateUser());
        dto.setCreateUserName(model.getCreateUserName());
        dto.setMainId(model.getMainId());

        return dto;
    }

}
